<%@ page session="true" import="nl.hva.web.mvcwebapp.chat.ChatRoomList, nl.hva.web.mvcwebapp.chat.ChatRoom" errorPage="error.jsp"%>
<%
    String nickname = (String) session.getAttribute("nickname");
    if (nickname != null && nickname.length() > 0) {
        ChatRoomList roomList = (ChatRoomList) application.getAttribute("chatroomlist");
        ChatRoom room = roomList.getRoomOfChatter(nickname);
        String roomname = room.getName();
%>

<HTML>
    <HEAD>
        <TITLE>Chat - <%=nickname%> (<%=roomname%>) </TITLE>

    </HEAD>
    <FRAMESET rows="80%,20%">
        <FRAME SRC="displayMessages.jsp#current" name="MessageWin">
            <FRAME SRC="sendMessage.jsp" name="TypeWin">
                </FRAMESET>
    <NOFRAMES>
        <H2>This chat requires a browser with frames support</h2>
    </NOFRAMES>
</HTML>
<%
    } else {
        response.sendRedirect(request.getContextPath() + "/chat/login.jsp");
    }
%>